package model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import android.framework.binding.BindableDate;
import android.framework.binding.BindableString;
import android.framework.binding.BindableValue;
import android.framework.binding.Item;

public class Bet extends Item{

	//According to specification - create a bet 
	private User owner;
	private Entity createOnEntity;
	private BindableString title = new BindableString();      
	private BindableString description = new BindableString();
	private List<BindableValue<BetSide>>  betSides = new ArrayList<BindableValue<BetSide>>();
	private BindableValue<Integer> betAmount = new BindableValue<Integer>(0);   // Schoom Himoor 
	private List<Entity> entityList = new ArrayList<Entity>(); 
	private BindableValue<BetVisibility> betVisibility = new BindableValue<BetVisibility>(BetVisibility.PRIVATE); 
	private BindableValue<BetDecisionType> decisionType = new BindableValue<BetDecisionType>(BetDecisionType.EVERYONE);
	private BindableValue<BetStatus> betStatus = new BindableValue<BetStatus>(BetStatus.BEFORE_DECISION);
	private BindableDate lastDateForBet = new BindableDate(new Date());
	private BindableDate decisionTime = new BindableDate(new Date());
	//Pictures list
	private Jackpot jackpot;
	private List<Comment> comments = new ArrayList<Comment>();
	private Role role;
	private BindableValue<BetSide> choosenBetSide = new BindableValue<BetSide>(null);
	
	public Bet() {
		jackpot = new Jackpot();
		role = Role.VIEWER;
	}

	public List<Comment> getComents() {
		return comments;
	}



	public void setComents(List<Comment> coments) {
		this.comments = coments;
	}



	public User getOwner() {
		return owner;
	}


	public void setOwner(User owner) {
		this.owner = owner;
	}


	public Jackpot getJackpot() {
		return jackpot;
	}

	public void setJackpot(Jackpot jackpot) {
		this.jackpot = jackpot;
	}



	public BindableString getTitle() {
		return title;
	}

	public void setTitle(BindableString title) {
		this.title = title;
	}

	public BindableString getDescription() {
		return description;
	}

	public void setDescription(BindableString description) {
		this.description = description;
	}

	public List<BindableValue<BetSide>> getBetSides() {
		return betSides;
	}

	//No setBetSides
	public void addBetSide(BindableValue<BetSide> betSide){
		betSides.add(betSide);
	} 
//TODO remove betSides
	public void setBetSides(List<BindableValue<BetSide>> betSides) {
		this.betSides = betSides;
	}

	public List<Entity> getEntityList() {
		return entityList;
	}

	public void setEntityList(List<Entity> entityList) {
		this.entityList = entityList;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public BindableValue<BetVisibility> getBetVisibility() {
		return betVisibility;
	}



	public void setBetVisibility(BindableValue<BetVisibility> betVisibility) {
		this.betVisibility = betVisibility;
	}



	public BindableValue<Integer> getBetAmount() {
		return betAmount;
	}



	public void setBetAmount(BindableValue<Integer> betAmount) {
		this.betAmount = betAmount;
	}



	public BindableValue<BetDecisionType> getDecisionType() {
		return decisionType;
	}



	public void setDecisionType(BindableValue<BetDecisionType> decisionType) {
		this.decisionType = decisionType;
	}



	public BindableValue<BetStatus> getBetStatus() {
		return betStatus;
	}



	public void setBetStatus(BindableValue<BetStatus> betStatus) {
		this.betStatus = betStatus;
	}

	public BindableDate getLastDateForBet() {
		return lastDateForBet;
	}

	public void setLastDateForBet(BindableDate lastDateForBet) {
		this.lastDateForBet = lastDateForBet;
	}

	public BindableDate getDecisionTime() {
		return decisionTime;
	}

	public void setDecisionTime(BindableDate decisionTime) {
		this.decisionTime = decisionTime;
	}

	public Entity getCreateOnEntity() {
		return createOnEntity;
	}

	public void setCreateOnEntity(Entity createOnEntity) {
		this.createOnEntity = createOnEntity;
	}

	public BetSide getChoosenBetSide() {
		return choosenBetSide.getValue();
	}
	
	public BindableValue<BetSide> getBindableChoosenBetSide() {
		return choosenBetSide;
	}

	public void setChoosenBetSide(BetSide choosenBetSide) {
		this.choosenBetSide.setValue(choosenBetSide);
	}


}
